home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / interapplication comm / 7edit / source / svaerecording.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  3.6 KB  |  113 lines

  1. /*
  2.     File:        SVAERecording.h
  3.  
  4.     Contains:    
  5.  
  6.     Written by: Original version by Jon Lansdell and Nigel Humphreys.
  7.                 3.1 updates by Greg Sutton.
  8.  
  9.     Copyright:    Copyright © 1995-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 7/20/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24. #ifndef __SVAERECORDING__
  25. #define __SVAERECORDING__
  26.  
  27. #include "SVEditGlobals.h"
  28.  
  29. #include "SVToken.h"
  30.  
  31. OSErr            InstallRecordingHandlers(void);
  32.  
  33. pascal OSErr     HandleStartRecording(const AppleEvent    *theAppleEvent,
  34.                                             AppleEvent    *reply,
  35.                                             long        handlerRefCon);    
  36.  
  37. pascal OSErr     HandleStopRecording(const AppleEvent    *theAppleEvent,
  38.                                             AppleEvent    *reply,
  39.                                             long        handlerRefCon);    
  40.  
  41. OSErr        MakeWindowObj(WindowPtr theWindow, AEDesc *result);
  42. OSErr        MakeDocumentObj(WindowPtr theWindow, AEDesc *result);
  43.  
  44. OSErr        MakeTextObjFromToken(TextToken* theToken, AEDesc* result);
  45. OSErr        MakeSelectedTextObj(WindowPtr    theWindow,
  46.                                 TEHandle    theTextEditHandle,
  47.                                 AEDesc        *result);
  48. OSErr        MakeTextObj(WindowPtr theWindow, short selStart, short selEnd, AEDesc *result);
  49.  
  50.  
  51. enum editCommandType
  52. {
  53.     editCutCommand   = 1,
  54.     editCopyCommand  = 2,
  55.     editPasteCommand = 3,
  56.     editClearCommand = 4
  57. };
  58.  
  59. typedef enum editCommandType editCommandType;
  60.  
  61. OSErr    SendSelectionEvent(DPtr docPtr);
  62. void    DoEditCommand(DPtr theDocument, editCommandType whatCommand);
  63. OSErr    SendAESetObjProp(AEDesc *theObj, DescType theProp, AEDesc *theData, AEAddressDesc *toWhom);
  64.  
  65.     // Text Commands
  66.     
  67. void    IssueCutCommand(DPtr theDocument);
  68. void    IssueCopyCommand(DPtr theDocument);
  69. void    IssuePasteCommand(DPtr theDocument);
  70. void    IssueClearCommand(DPtr theDocument);
  71. void    IssueFontCommand(DPtr theDocument, short theItem);
  72. void    IssueSizeCommand(DPtr theDocument, short theItem);
  73. void    IssueStyleCommand(DPtr theDocument, short theItem);
  74.  
  75.     // Window Commands
  76.  
  77. void    IssueZoomCommand(WindowPtr whichWindow, short whichPart);
  78. void    IssueCloseCommand(WindowPtr whichWindow);
  79. void    IssueSizeWindow(WindowPtr whichWindow, short newHSize,short newVSize);
  80. void    IssueMoveWindow(WindowPtr whichWindow, Rect sizeRect);
  81. void    IssuePageSetupWindow(WindowPtr whichWindow, TPrint thePageSetup);
  82. void    IssueGXPageSetupWindow(WindowPtr whichWindow, gxJob thGXJob);
  83.  
  84. #define kUsePrintDialog true
  85. #define kNoPrintDialog false
  86. void    IssuePrintWindow( WindowPtr whichWindow, Boolean useDialog);
  87.  
  88.     // Document Commands
  89.  
  90. OSErr    IssueAEOpenDoc(FSSpec myFSSpec);
  91. void    IssueAENewWindow(void);
  92. OSErr    IssueSaveCommand(WindowPtr theWindow, FSSpecPtr where);
  93.                                                 
  94. OSErr    IssueRevertCommand(WindowPtr theWindow);
  95. OSErr    IssueQuitCommand(void);
  96.  
  97.     // Recording of Keystrokes
  98.  
  99. void    AddKeyToTypingBuffer(DPtr theDocument, char theKey);
  100. void    FlushAndRecordTypingBuffer(void);
  101.  
  102.  
  103. void    StyleTokConst(short theStyleItem, DescType *thekConst);
  104. OSErr    BuildTypeTextStylesDesc(Style onStyles, Style offStyles, AEDesc *resultDesc);
  105. OSErr    BuildTextStylesDesc(Style theStyle, AEDesc *resultDesc);
  106. OSErr    BuildStyledTextDesc(TEHandle theHTE, short start, short howLong, AEDesc *resultDesc);
  107.  
  108.  
  109. Boolean    PoseSizeDialog(long *whatSize);
  110. OSErr    IssueSetDataObjToBufferContents(const AEDesc* theObj);
  111.  
  112. #endif
  113.